﻿/*
____
 L|ypps Web controls for ASP.NET

Copyright (c) 2009 Alessandro Zifiglio, http://www.Typps.com
EMail: alessandro@Typps.com

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
namespace Typps
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Linq;
    using System.Text;
    using System.Web;

    #region Enumerations

    public enum AttributePosition
    {
        Begin = 0,
        End = 1
    }

    public enum ButtonDirection
    {
        Left,
        Right
    }

    public enum CharacterLocation
    {
        OuterHTML = 0,
        InnerHTML = 1
    }

    public enum ClientEventType
    {
        click,
        mousedown,
        mouseover
    }

    public enum ControlName
    {
        Editor,
        ImagePicker,
        UpdateProgressPanel,
        ColorPicker,
        MediaFrame,
        SlidePane
    }

    public enum CssFile
    {
        Auto,/*The control has enough information to determine the css file*/
        ImageSpritesAdvanced,
        ImageSpritesBasic,
        Icons,
        ImagePicker,
        MediaFrame,
        ColorPicker,
        UpdatePanelProgress,
        TreeView,
        Shared
    }

    public enum CssFloatStyle
    {
        NotSet,
        None,
        Left,
        Right
    }

    public enum Dir
    {
        LTR,
        RTL
    }

    public enum DisplayMode
    {
        NotSet,
        Block,
        Inline,
        None
    }

    public enum EffectRunMode
    {
        /// <summary>
        /// The default runmode is AddParellelEffect.
        /// </summary>
        UseDefault,
        /// <summary>
        /// Using AddParallelEffect causes all of the registered effects to run in parallel.
        /// In other words, the registered Effects run together.
        /// </summary>
        AddParallelEffect,
        /// <summary>
        /// using AddNextEffect causes all of the registered effects to run one after the other.
        /// In other words, as one effects finishes, the next registered effect will run and so on.
        /// </summary>
        AddNextEffect
    }

    public enum IconType
    {
        ImageSprites = 0,
        Icons = 1
    }

    public enum IISVersion
    {
        IIS6,
        IIS7
    }

    public enum MediaItemOverflow
    {
        AllowDrag,
        SqueezeToFit
    }

    public enum MediaType
    {
        Images,
        Multimedia
    }

    public enum OverflowStyle
    {
        NotSet,
        Auto,
        Visible,
        Scroll,
        Hidden
    }

    public enum PathType
    {
        Physical,
        Relative
    }

    public enum Position
    {
        ModalPopup,
        Static
    }

    public enum PositionHorizontal
    {
        NotSet,
        Left,
        Center,
        Right
    }

    public enum PositionStyle
    {
        NotSet,
        Absolute,
        Static,
        Relative
    }

    public enum PositionVertical
    {
        NotSet,
        Top,
        Center,
        Bottom
    }

    public enum SkinNames
    {
        Classic,
        BlueSteel,
        KnightRider
    }

    public enum SpecialEffectActivation
    {
        NotSet,
        pageload,
        click,
        mousedown,
        mouseover,
        mouseup,
    }

    public enum Strip
    {
        Letter,
        Punctuation
    }

    public enum StripMode
    {
        TagOnly = 0,
        TagAndContent = 1
    }

    public enum TagType
    {
        opening,
        closing
    }

    public enum ToolBarType
    {
        Basic = 0,
        Advanced = 1
    }

    public enum TransitionName
    {
        linearTransition,
        sinusoidalTransition,
        squareTransition,
        squarerootTransition,
        fifthTransition,
        circleTransition,
        pulsateTransition,
        growSpecificTransition
    }

    #endregion Enumerations

    public class Globals
    {
        #region Properties

        [Browsable(false)]
        public static bool IsAsyncCallBack
        {
            get
            {
                string key = "iscallback$Typps";
                string value = HttpContext.Current.Request.Form[key];
                return (!string.IsNullOrEmpty(value));
            }
        }

        /// <summary>
        /// Use this static boolean method when wanting to detect postbacks caused by the
        /// editor. This property returns true if the postback was caused by the htmleditor
        /// when switching back and forth between designview/htmlview as this is required
        /// for html validation (which is done serverside).
        /// </summary>
        [Browsable(false)]
        public static bool IsCallBackForHtmlView
        {
            get
            {
                string key = "iscallback$htmlview$Typps";
                string value = HttpContext.Current.Request.Form[key];
                return (!string.IsNullOrEmpty(value));
            }
        }

        [Browsable(false)]
        public static bool IsCallBackForSave
        {
            get
            {
                string key = "iscallback$save$Typps";
                string value = HttpContext.Current.Request.Form[key];
                return (!string.IsNullOrEmpty(value));
            }
        }

        #endregion Properties
    }
}